import Request from './api.js'
import {SCREEN_BASE} from './api.js';

let request = new Request().http

export const InventoryStatistics= function(type) {    
	var url = SCREEN_BASE + "/CPInventoryStatistics";
	if (type == 1){
		url = SCREEN_BASE + "/YLInventoryStatistics";
	}
    return request({
		url: url,
        method: "POST",
		data: {}
    })
}

export const RealTimeInventoryTop= function(type) {    
	var url = SCREEN_BASE + "/CPRealTimeInventoryTop";
	if (type == 1){
		url = SCREEN_BASE + "/YLRealTimeInventoryTop";
	}
    return request({
		url: url,
        method: "POST",
		data: {}
    })
}

export const RealTimeInventoryAll= function(type) {    
	var url = SCREEN_BASE + "/CPRealTimeInventoryAll";
	if (type == 1){
		url = SCREEN_BASE + "/YLRealTimeInventoryAll";
	}
    return request({
		url: url,	
        method: "POST",
		data: {}
    })
}

export const RealTimeInventoryDetaiTop= function(type) {    
	var url = SCREEN_BASE + "/CPRealTimeInventoryDetaiTop";
	if (type == 1){
		url = SCREEN_BASE + "/YLRealTimeInventoryDetaiTop";
	}
    return request({
		url: url,		
        method: "POST",
		data: {}
    })
}

export const RealTimeInventoryDetaiAll= function(type) {    
	var url = SCREEN_BASE + "/CPRealTimeInventoryDetaiAll";
	if (type == 3){
		url = SCREEN_BASE + "/YLRealTimeInventoryDetaiAll";
	}
    return request({
		url: url,		
        method: "POST",
		data: {}
    })
}

export const InventoryPieChart= function(type) {    
	var url = SCREEN_BASE + "/CPInventoryPieChart";
	if (type == 1){
		url = SCREEN_BASE + "/YLInventoryPieChart";
	}
    return request({
		url: url,		
        method: "POST",
		data: {}
    })
}

export const GetAllCount= function(type) {    
	var url = SCREEN_BASE + "/GetAllCPCCount";
	if (type == 1){
		url = SCREEN_BASE + "/GetAllYLCCount";
	}
    return request({
		url: url,		
        method: "POST",
		data: {}
    })
}